export function getRecentDates() {
	const dates = [];
	const today = new Date();
	const oneDay = 24 * 60 * 60 * 1000;

	for (let i = 0; i <= 9; i++) {
		const date = new Date(today - (i * oneDay));
		const formattedDate = formatDate(date);
		dates.push(formattedDate);
	}

	return dates;
}

export function formatDate(date) {
	const year = date.getFullYear();
	const month = (date.getMonth() + 1).toString().padStart(2, '0');
	const day = date.getDate().toString().padStart(2, '0');
	const hours = date.getHours().toString().padStart(2, '0');
	const minutes = date.getMinutes().toString().padStart(2, '0');
	const seconds = date.getSeconds().toString().padStart(2, '0');
	// ${year}-${hours}:${minutes}:${seconds}
	return `${month}-${day}`;
}